home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
fopen
/
fopdemo.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
3KB
|
89 lines
VERSION 2.00
Begin Form FOpenDemo
Caption = "Win3 Style File Open Demo"
ClientHeight = 2655
ClientLeft = 1230
ClientTop = 1995
ClientWidth = 5685
Height = 3345
Left = 1170
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 2655
ScaleWidth = 5685
Top = 1365
Width = 5805
Begin Label Demo4
Caption = "ThePattern: "
Height = 375
Left = 480
TabIndex = 3
Top = 2040
Width = 4695
End
Begin Label Demo3
Caption = "TheFileName: "
Height = 375
Left = 480
TabIndex = 2
Top = 1440
Width = 4575
End
Begin Label Demo2
Caption = "ThePath: "
Height = 375
Left = 480
TabIndex = 1
Top = 840
Width = 4575
End
Begin Label Demo1
Caption = "FullName: "
Height = 375
Left = 480
TabIndex = 0
Top = 240
Width = 4575
End
Begin Menu File
Caption = "&File"
Begin Menu FileOpen
Caption = "&Open"
End
Begin Menu MenuSeparator1
Caption = "-"
End
Begin Menu Done
Caption = "&Exit"
End
End
End
Sub Done_Click ()
' Bye
End
End Sub
Sub FileOpen_Click ()
' Before calling FOPEN.FRM we can specify a new pattern (ThePattern) a new path
' (ThePath) and a different Form Title. Change FullName to an empty string.
FullName = ""
ThePattern = "*.*" ' you can also combine patterns, e.g. ThePattern = "*.BAS;*.FRM;*.TXT"
FormTitle = "Demo File Open"
' We want to show the form Modal and Unload it after completion (no reason to
' waste resources).
FOpenForm.Show Modal
Unload FOpenForm
' The demo prints out the user's selection. Note: FullName will be an empty string if
' the user cancels. So check FullName on return from FOPEN to see whether to process
' the file.
If Len(FullName) = 0 Then FullName = "No File Selected"
demo1.caption = "FullName: " + FullName
demo2.caption = "ThePath: " + ThePath
demo3.caption = "TheFileName: " + TheFileName
demo4.caption = "ThePattern: " + ThePattern
End Sub